package cn.clq.ymcc.web.controller;

import cn.clq.ymcc.result.JSONResult;
import cn.clq.ymcc.service.IOrderTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author clqlongbao
 * @version 1.0
 * @description: 创建订单的防重token
 * @date 2022/7/28 16:01
 */
@RestController
public class OrderTokenController {

    @Autowired
    private IOrderTokenService orderTokenService;

    @GetMapping("/createToken/{courseId}")
    public JSONResult createOrderToken(@PathVariable("courseId") String courseId){
        String orderToken = orderTokenService.createOrderToken(courseId);
        return JSONResult.success(orderToken);
    }
}
